#include "display_task.h"
#include "app_message.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "TOUCH/ft5446u.h"
#include "../Middlewares/lvgl/examples/porting/lv_port_disp_template.h"
#include "../Middlewares/lvgl/examples/porting/lv_port_indev_template.h"
#include "../Middlewares/lvgl/demos/benchmark/lv_demo_benchmark.h"
#include "../Middlewares/lvgl/demos/widgets/lv_demo_widgets.h"
#include "../Middlewares/lvgl/my_gui/my_gui.h"

void display_up_data(void) {
    MessageId msgSend = MSG_DISPLAY_UPDATE;
    xQueueSend(GetDisplayMessageHandle(), &msgSend, 10);
}

void DisplayTaskEntrance(void) {
    MessageId msgRecv;

    FT5446U_Init();
    lv_init();                  /* lvgl系统初始化 */
    lv_port_disp_init();        /* lvgl显示接口初始化,放在lv_init()的后面 */
    lv_port_indev_init();       /* lvgl输入接口初始化,放在lv_init()的后面 */

//    lv_demo_benchmark();
    lv_demo_widgets();
//    my_gui();

    DBG("Display task init ok\n");
    /* Infinite loop */
    for (;;)
    {
        lv_timer_handler();
        vTaskDelay(10);
    }
}
